class code2 {
    //移动0
    //先将left和right换，再换0和left这样顺序就是固定的了
    public void moveZeroes(int[] nums) {
        int left = 0;
        int right = 0;

        while(right < nums.length) {
            if(nums[right] != 0) {
                int tmp = nums[left];
                nums[left] = nums[right];
                nums[right] = tmp;
                left++;
            }
            right++;
        }
    }
}